tools: api_booster tool for upgrading Envoy APIs.#9258
tools: api_booster tool for upgrading Envoy APIs.#9258htuch wants to merge 5 commits intoenvoyproxy:masterfrom
Conversation
This is a beachhead PR for a Clang Libtooling based workflow that automagically updates Envoy's source tree to the latest API version for every referenced package. So far, ths tool is only capable of inferring types and performing header fixups, later PRs will expand this. Risk level: Low Testing: Manual cleanup of all headers in source/ test/ and include/, all tests pass. Part of envoyproxy#8082 Signed-off-by: Harvey Tuch <htuch@google.com>
|
@mattklein123 @lizan @derekargueta there are a few TODOs still in there, but this is basically the next step in the automagic updates. The meat of this PR is everything in |
| # Figure out where the LLVM include path is. We need to provide this | ||
| # explicitly as the api_booster is built inside the Bazel cache and doesn't | ||
| # know about this path. | ||
| # TODO(htuch): this is fragile and depends on Clang version, should figure out |
There was a problem hiding this comment.
Do you know what library you need from clang/9.0.0/include? The versioned include only have headers for compiler-rt, so I doubt you actually need this.
There was a problem hiding this comment.
If I don't declare this as -isystem, I see:
...clang-9.0/lib/clang/9.0.0/include/mmintrin.h:50:12: error: use of old-style cast [-Werror,-Wold-style-cast]
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
since it doesn't recognize these libraries as system libs (and hence subject to relaxation of the warning).
| @@ -35,7 +35,38 @@ py_binary( | |||
| ], | |||
| ) | |||
|
|
|||
| # Pack API type database text file into a char* string that can be referenced | |||
| # at the C++ level. | |||
| genrule( | |||
There was a problem hiding this comment.
should we generate this cc in type_database rule in #9276?
There was a problem hiding this comment.
Is there a big win from this? Since this genrule just gets invoked on the artifact from type_database() and is only ever consumed in one place (api_type_db_lib), it's easier to read/maintain if this is outside of a Bazel rule and we just use stock genrule.
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
|
@lizan this is ready for another review, thanks. |
|
Closing this out now that #9329 has merged, to simplify the followup API booster application. |
This is a beachhead PR for a Clang Libtooling based workflow that automagically updates Envoy's
source tree to the latest API version for every referenced package. So far, ths tool is only capable
of inferring types and performing header fixups, later PRs will expand this.
Risk level: Low
Testing: Manual cleanup of all headers in source/ test/ and include/, all tests pass.
Part of #8082
Signed-off-by: Harvey Tuch htuch@google.com